﻿using System;
using GDIT.Base.PageBaseHelper;
using GDIT.BLL;
using GDIT.Model;

namespace GDIT.page.notice
{
    public partial class article : System.Web.UI.Page
    {

        private BBulletinArticle bulletin = null;
        private Mtb_BulletinArticle bulletinInfo = null;
        private BCollegeInformationArticle college = null;
        private Mtb_CollegeInformationArticle collegeInfo = null;

        protected void Page_Load(object sender, EventArgs e)
        {
            string parm = Request.QueryString["param"];
            this.hdfParm.Value = parm; 
            string[] parms = parm.Split('_');
            if (parms[0] == "bulletin")
            {
                string id = parms[1]; //根据文章id查询通知
                BindBulletinArticle(Convert.ToInt32(id));
            }
            else if (parms[0] == "information")
            {
                string id = parms[1]; //根据文章id查询资讯
                BindCollegeInfo(Convert.ToInt32(id));
            }
        }

        private void BindBulletinArticle(int id)
        {
            bulletin = new BBulletinArticle();
            bulletinInfo = new Mtb_BulletinArticle();
            bulletinInfo = bulletin.SelectBulletinArticleById(id);
            this.ltrArticle.Text = bulletinInfo.Contents;
            this.labTitle.Text = bulletinInfo.Title;
        }

        private void BindCollegeInfo(int id)
        {
            college = new BCollegeInformationArticle();
            collegeInfo = new Mtb_CollegeInformationArticle();
            collegeInfo = college.SelectCollegeInformationArticleById(id);
            this.ltrArticle.Text = collegeInfo.Contents;
            this.labTitle.Text = collegeInfo.Title;
        }
    }
}